<template>
  <CloudCascader style="width: 360px" :options="options" change-on-select @change="onChange">
  </CloudCascader>
</template>

<script>
  export default {
    title: '7.选择即改变',
    subTitle: '这种交互允许只选中父级选项。',
    data () {
      return {
        options: [
          {
            value: 'zhejiang',
            label: 'Zhejiang',
            children: [
              {
                value: 'hangzhou',
                label: 'Hangzhou',
                children: [
                  {
                    value: 'xihu',
                    label: 'West Lake',
                  },
                ],
              },
            ],
          },
          {
            value: 'jiangsu',
            label: 'Jiangsu',
            children: [
              {
                value: 'nanjing',
                label: 'Nanjing',
                children: [
                  {
                    value: 'zhonghuamen',
                    label: 'Zhong Hua Men',
                  },
                ],
              },
            ],
          },
        ],
      }
    },
    methods: {
      onChange (value) {
        console.log(value);
      }
    }
  }
</script>

<style lang="scss">
</style>